package lab02.Test06;

/**
 * Created by 卡01 on 2017/10/15.
 */
public class Triangle {
    //属性：类型为double的三个边，以及周长、面积、Boolean型
    double edge1;
    double edge2;
    double edge3;
    public Triangle(double edge1,double edge2,double edge3){
        this.edge1=edge1;
        this.edge2=edge2;
        this.edge3=edge3;
    }
    double perimrter;
    double area;
    boolean judge;
    //行为、方法：返回周长、面积以及修改三个边
    double perimeter(){
        return edge1+edge2+edge3;
    }
    double area(){
        double high;
        high=(edge1+edge2+edge3)/2;
        return Math.sqrt(high*(high-edge1)*(high-edge2));
    }
    void judge(){
        if(edge1+edge2<edge3||edge1+edge3<edge2||edge3+edge2<edge1)
            System.out.println("不能构成三角形");
        else
            System.out.println("能构成三角形");
    }
    //构造函数
    //main函数
    public static void main(String[] args) {

    }
}

